home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ für Kids
/
C++ for kids.iso
/
Buch
/
Rund1a.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1998-12-27
|
2KB
|
48 lines
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "Rund1a.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
int i;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Canvas->Ellipse (30,30,180,180);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Timer1->Enabled = true;
i = 25;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Timer1->Enabled = false;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
TRect Quelle, Ziel;
Timer1->Interval = 10;
Quelle = Rect(i, 25, i+155, 185);
Ziel = Rect (i+5, 25, i+160, 185);
Canvas->CopyRect(Ziel, Canvas, Quelle);
i = i + 5;
if (i>=ClientWidth-190) Timer1->Enabled = false;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Repaint ();
}
//---------------------------------------------------------------------------